﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using MaxLeaf.KH.DataContract;
using System.Reflection;

namespace MaxLeaf.KH.Contract
{
    [ServiceContract]
    [ServiceKnownType("GetKnownTypes", typeof(KnownTypesProvider))]    
    public interface IBasicMtn 
    {
        [OperationContract]
        object Select(object model, int intKeyValue);

        [OperationContract]
        List<object>  SelectDtl(object model, int intForeignKeyValue);

        [OperationContract]
        object Add(object model);

        [OperationContract]
        object Update(object model);

        [OperationContract]
        object Delete(object model);
    }

    static class KnownTypesProvider
    {

        static Type[] GetKnownTypes(ICustomAttributeProvider knownTypeAttributeTarget)
        {

            return Assembly.Load("MaxLeaf.KH.DataContract").GetTypes();

        }

    }

}
